
from conn_mysql.api_mysql import ApiMysql

from flask import Flask, request, Blueprint, render_template

from . import app_login

app = Flask(__name__)

@app_login.route('/reset_password', methods=['GET', 'POST'])

def reset_password():

    methods = request.method

    info = request.form

    phone = info.get('user')
    
    verify_code = info.get('verify_code')
    
    new_pass_word_1 = info.get('new_pass_word_1')

    new_pass_word_2 = info.get('new_pass_word_2')

    with ApiMysql() as conn_api:

        conn_info = conn_api.reset_password(methods, phone, verify_code, new_pass_word_1, new_pass_word_2)

    return conn_info
